// vite.config.ts
import { defineConfig } from "file:///D:/neOutSource/new-pc-cashier/new-pc-cashier/node_modules/vite/dist/node/index.js";
import path from "node:path";
import electron from "file:///D:/neOutSource/new-pc-cashier/new-pc-cashier/node_modules/vite-plugin-electron/dist/simple.mjs";
import vue from "file:///D:/neOutSource/new-pc-cashier/new-pc-cashier/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import legacy from "file:///D:/neOutSource/new-pc-cashier/new-pc-cashier/node_modules/@vitejs/plugin-legacy/dist/index.mjs";
var __vite_injected_original_dirname = "D:\\neOutSource\\new-pc-cashier\\new-pc-cashier";
function replaceNodeGlobals() {
  return {
    name: "replace-node-globals",
    transform(code, id) {
      if (id.includes("node_modules") && code.includes("__dirname")) {
        return {
          code: code.replace(/__dirname/g, 'import.meta.url ? new URL(".", import.meta.url).pathname : undefined'),
          map: null
        };
      }
    }
  };
}
var vite_config_default = defineConfig({
  plugins: [
    vue(),
    legacy({
      targets: ["defaults", "not IE 11"],
      additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
      renderLegacyChunks: false,
      // 禁用重复渲染，只生成传统版本
      polyfills: [
        "es.symbol",
        "es.array.filter",
        "es.promise",
        "es.promise.finally",
        "es/map",
        "es/set",
        "es.array.for-each",
        "es.object.define-properties",
        "es.object.get-own-property-descriptor",
        "es.object.get-own-property-descriptors",
        "es.object.keys",
        "es.object.to-string",
        "web.dom-collections.for-each",
        "esnext.global-this",
        "esnext.string.match-all"
      ]
    }),
    electron({
      main: {
        // Shortcut of `build.lib.entry`.
        entry: "electron/main.ts",
        vite: {
          plugins: [replaceNodeGlobals()],
          build: {
            outDir: "dist-electron",
            rollupOptions: {
              external: ["better-sqlite3", "sqlite3"],
              output: {
                format: "es",
                entryFileNames: "main.js"
              }
            }
          }
        }
      },
      preload: {
        // Shortcut of `build.rollupOptions.input`.
        // Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`.
        input: path.join(__vite_injected_original_dirname, "electron/preload.ts")
      },
      // Ployfill the Electron and Node.js API for Renderer process.
      // If you want use Node.js in Renderer process, the `nodeIntegration` needs to be enabled in the Main process.
      // See 👉 https://github.com/electron-vite/vite-plugin-electron-renderer
      renderer: process.env.NODE_ENV === "test" ? void 0 : {}
    })
  ],
  resolve: {
    alias: {
      "@": path.resolve(__vite_injected_original_dirname, "./src"),
      "@components": path.resolve(__vite_injected_original_dirname, "./src/components"),
      "@views": path.resolve(__vite_injected_original_dirname, "./src/views"),
      "@utils": path.resolve(__vite_injected_original_dirname, "./src/utils"),
      "@api": path.resolve(__vite_injected_original_dirname, "./src/api"),
      "@stores": path.resolve(__vite_injected_original_dirname, "./src/stores"),
      "@types": path.resolve(__vite_injected_original_dirname, "./src/types")
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "@/styles/variables.scss" as *;`
      }
    }
  },
  server: {
    port: 3e3,
    host: true
  },
  envDir: path.resolve(__vite_injected_original_dirname, "./env")
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFxuZU91dFNvdXJjZVxcXFxuZXctcGMtY2FzaGllclxcXFxuZXctcGMtY2FzaGllclwiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcbmVPdXRTb3VyY2VcXFxcbmV3LXBjLWNhc2hpZXJcXFxcbmV3LXBjLWNhc2hpZXJcXFxcdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0Q6L25lT3V0U291cmNlL25ldy1wYy1jYXNoaWVyL25ldy1wYy1jYXNoaWVyL3ZpdGUuY29u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